list3 = [x for x in range(6)]
print(list3)
# [0, 1, 2, 3, 4, 5]


list4 = [('name','zhangsan'),('age',22),('phone',110)]
dict = {key:value for key,value in list4}
print(dict) # {'name': 'zhangsan', 'age': 22, 'phone': 110}

list1 = ['asd','sdf','freg','sfag','refv','aser','sdfr','dfgi']
#取出所有带a的
#普通写法
rs_list = []
for s in list1:
    if 'a' in s:
        rs_list.append(s)
print(rs_list)
#列表生成式
list2 = [x for x in list1 if 'a' in x]
print(list2)